Package | medcom.fhir.dk.carecommunicationtestscripts |
Type | TestScript |
Id | Id |
FHIR Version | R4 |
Source | http://medcomfhir.dk/ig/carecommunicationtestscripts/http://medcomfhir.dk/ig/carecommunicationtestscripts/4.0.1/TestScript-carecommunication-send-forward-message.html |
Url | http://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-forward-message |
Version | 4.0.1 |
Status | active |
Date | 2024-07-15 |
Name | CareCommunicationTestScript |
Title | Forward CareCommunication |
Experimental | False |
Realm | dk |
Description | Forward CareCommunication |
Copyright | MedCom 2023 |
No resources found
No resources found
Note: links and images are rebased to the (stated) source
Generated Narrative: TestScript carecommunication-send-forward-message
url: TestScript Forward CareCommunication
version: 4.0.1
name: CareCommunicationTestScript
title: Forward CareCommunication
status: Active
date: 2024-07-15
contact: MedCom: mailto:fhir@medcom.dk
description:
Forward CareCommunication
copyright:
MedCom 2023
Index | Profile |
1 | Test script profile origin type FHIR-Client: FHIR Client |
Index | Profile |
1 | Test script profile destination type FHIR-Server: FHIR Server |
fixture
id
create-new-message-01autocreate: false
autodelete: false
resource: /Fixtures/CareCommunication-fixture.xml
fixture
id
create-forward-message-02autocreate: false
autodelete: false
profile: ??
variable
name: messageHeaderid-new-message-01
expression: Bundle.entry[0].resource.id
sourceId: create-message-new-message-01
variable
name: destinationUri-new-message-01
expression: Bundle.entry.resource.ofType(MessageHeader).destination.endpoint
sourceId: create-message-new-message-01
variable
name: bundleid-new-message-01
expression: Bundle.id
sourceId: create-message-new-message-01
variable
name: hospitalSOR-new-message-01
expression: Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value
sourceId: create-message-new-message-01
variable
name: messageHeaderid-forward-message-02
expression: Bundle.entry[0].resource.id
sourceId: create-message-forward-message-02
variable
name: identifier-new-message-01
expression: Bundle.entry.resource.ofType(Communication).identifier.value
sourceId: create-message-new-message-01
variable
name: identifier-forward-message-02
expression: Bundle.entry.resource.ofType(Communication).identifier.value
sourceId: create-message-forward-message-02
setup
action
Operations
Type Resource Description Accept EncodeRequestUrl Params Test script operation code delete: Delete Bundle System-generated search, delete operations from conditional delete on Bundle MessageHeader.destination.endpoint xml true ?message.destination-uri=${destinationUri-new-message} action
Operations
Type Resource Description Accept ContentType EncodeRequestUrl SourceId Test script operation code create: Create Bundle Create the Bundle resource in XML format on the destination server. xml xml true create-new-message-01 action
Operations
Type Resource Description Accept ContentType EncodeRequestUrl Params SourceId Test script operation code updateCreate: Create using Update Bundle Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-new-message-01. xml xml true /${bundleid-new-message-01} create-new-message-01 action
Asserts
Description Direction Operator ResponseCode WarningOnly Confirm that the returned HTTP status is okay or created. response in 200,201 false
test
id
message-read-new-message-01name: Get a new-message message 01
description: GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format.
action
Operations
Type Resource Description Accept Destination EncodeRequestUrl Origin Params Test script operation code read: Read Bundle Receive message xml 1 true 1 /${bundleid-new-message-01} action
Asserts
Description Direction Operator ResponseCode WarningOnly Confirm that the returned HTTP status is okay or created. response in 200,201 false
test
id
carecommunication-create-forward-message-02name: Create a CareCommunication forward-message Message 02
description: Post CareCommunication to the server.
action
Operations
Type Resource Description Destination EncodeRequestUrl Origin RequestId SourceId Test script operation code create: Create Bundle Post a carecommunication 1 true 1 create-message-forward-message-02 create-forward-message-02 action
Asserts
Description Direction ValidateProfileId WarningOnly Validates the bundle against http://medcomfhir.dk/ig/carecommunication/ImplementationGuide/dk.fhir.ig.dk-medcom-carecommunication request carecommunication false action
Asserts
Description Direction Operator ResponseCode WarningOnly Confirm that the returned HTTP status is okay or created. response in 200,201 false action
Asserts
Description Direction Resource WarningOnly Confirm that the client request payload contains a Bundle resource type. request Bundle false action
Asserts
Description Direction Expression WarningOnly Confirm that the previous MessageHeader.id is identical to Provenance.entity.what request Bundle.entry.resource.ofType(Provenance).where(entity.what.reference.contains('${messageHeaderid-new-message-01}')).exists() false action
Asserts
Description Direction Expression WarningOnly Confirm that the request resource contains the expected eventCoding.code. request Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'care-communication-message').allTrue() false action
Asserts
Description Direction Expression WarningOnly Confirm that the role is set to revision. Not used when testing the first message in a stream request Bundle.entry.resource.ofType(Provenance).entity.where(role = 'revision').exists() false action
Asserts
Description Direction Expression WarningOnly Confirm that the target reference in Provenance equals MessageHeader.id request Bundle.entry.resource.ofType(Provenance).where(target.reference.contains(%resource.entry[0].resource.id)).exists() false action
Asserts
Description Direction Expression Operator Value WarningOnly Confirm that the 2 Provenance instances exists. request Bundle.entry.resource.ofType(Provenance).count() equals 2 false action
Asserts
Description Direction Expression WarningOnly Confirm that number of payloads is '2' request Bundle.entry.resource.ofType(Communication).payload.count() = '2' false action
Asserts
Description Direction Expression WarningOnly Confirm that the sender SOR number is different from the previous message. request Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value != ${hospitalSOR-new-message}) false action
Asserts
Description Direction Expression WarningOnly Confirm that the content is different in the two messages request '${identifier-new-message-01}' != '${identifier-forward-message-02}' false
{
"resourceType" : "TestScript",
"id" : "carecommunication-send-forward-message",
"meta" : {
"profile" : [
"http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"
]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: TestScript carecommunication-send-forward-message</b></p><a name=\"carecommunication-send-forward-message\"> </a><a name=\"hccarecommunication-send-forward-message\"> </a><a name=\"carecommunication-send-forward-message-en-US\"> </a><p><b>url</b>: <a href=\"TestScript-carecommunication-send-forward-message.html\">TestScript Forward CareCommunication</a></p><p><b>version</b>: 4.0.1</p><p><b>name</b>: CareCommunicationTestScript</p><p><b>title</b>: Forward CareCommunication</p><p><b>status</b>: Active</p><p><b>date</b>: 2024-07-15</p><p><b>contact</b>: MedCom: <a href=\"mailto:mailto:fhir@medcom.dk\">mailto:fhir@medcom.dk</a></p><p><b>description</b>: </p><div><p>Forward CareCommunication</p>\n</div><p><b>copyright</b>: </p><div><p>MedCom 2023</p>\n</div><h3>Origins</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td style=\"display: none\">*</td><td>1</td><td><a href=\"http://terminology.hl7.org/5.5.0/CodeSystem-testscript-profile-origin-types.html#testscript-profile-origin-types-FHIR-Client\">Test script profile origin type FHIR-Client</a>: FHIR Client</td></tr></table><h3>Destinations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td style=\"display: none\">*</td><td>1</td><td><a href=\"http://terminology.hl7.org/5.5.0/CodeSystem-testscript-profile-destination-types.html#testscript-profile-destination-types-FHIR-Server\">Test script profile destination type FHIR-Server</a>: FHIR Server</td></tr></table><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-new-message-01</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href=\"/Fixtures/CareCommunication-fixture.xml\">/Fixtures/CareCommunication-fixture.xml</a></p></blockquote><blockquote><p><b>fixture</b></p><blockquote><p><b>id</b></p>create-forward-message-02</blockquote><p><b>autocreate</b>: false</p><p><b>autodelete</b>: false</p><p><b>resource</b>: <a href=\"/Fixtures/CareCommunication-fixture-empty.xml\">/Fixtures/CareCommunication-fixture-empty.xml</a></p></blockquote><p><b>profile</b>: <a href=\"http://medcomfhir.dk/ig/carecommunication/4.0.1/StructureDefinition-medcom-careCommunication-message.html\">??</a></p><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-new-message-01</p><p><b>expression</b>: Bundle.entry[0].resource.id</p><p><b>sourceId</b>: create-message-new-message-01</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: destinationUri-new-message-01</p><p><b>expression</b>: Bundle.entry.resource.ofType(MessageHeader).destination.endpoint</p><p><b>sourceId</b>: create-message-new-message-01</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: bundleid-new-message-01</p><p><b>expression</b>: Bundle.id</p><p><b>sourceId</b>: create-message-new-message-01</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: hospitalSOR-new-message-01</p><p><b>expression</b>: Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value</p><p><b>sourceId</b>: create-message-new-message-01</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: messageHeaderid-forward-message-02</p><p><b>expression</b>: Bundle.entry[0].resource.id</p><p><b>sourceId</b>: create-message-forward-message-02</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: identifier-new-message-01</p><p><b>expression</b>: Bundle.entry.resource.ofType(Communication).identifier.value</p><p><b>sourceId</b>: create-message-new-message-01</p></blockquote><blockquote><p><b>variable</b></p><p><b>name</b>: identifier-forward-message-02</p><p><b>expression</b>: Bundle.entry.resource.ofType(Communication).identifier.value</p><p><b>sourceId</b>: create-message-forward-message-02</p></blockquote><blockquote><p><b>setup</b></p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Accept</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td></tr><tr><td style=\"display: none\">*</td><td><a href=\"http://terminology.hl7.org/5.5.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-delete\">Test script operation code delete</a>: Delete</td><td>Bundle</td><td>System-generated search, delete operations from conditional delete on Bundle MessageHeader.destination.endpoint</td><td>xml</td><td>true</td><td>?message.destination-uri=${destinationUri-new-message}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Accept</b></td><td><b>ContentType</b></td><td><b>EncodeRequestUrl</b></td><td><b>SourceId</b></td></tr><tr><td style=\"display: none\">*</td><td><a href=\"http://terminology.hl7.org/5.5.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-create\">Test script operation code create</a>: Create</td><td>Bundle</td><td>Create the Bundle resource in XML format on the destination server.</td><td>xml</td><td>xml</td><td>true</td><td>create-new-message-01</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Accept</b></td><td><b>ContentType</b></td><td><b>EncodeRequestUrl</b></td><td><b>Params</b></td><td><b>SourceId</b></td></tr><tr><td style=\"display: none\">*</td><td><a href=\"http://terminology.hl7.org/5.5.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-updateCreate\">Test script operation code updateCreate</a>: Create using Update</td><td>Bundle</td><td>Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-new-message-01.</td><td>xml</td><td>xml</td><td>true</td><td>/${bundleid-new-message-01}</td><td>create-new-message-01</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the returned HTTP status is okay or created.</td><td>response</td><td>in</td><td>200,201</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>message-read-new-message-01</blockquote><p><b>name</b>: Get a new-message message 01</p><p><b>description</b>: GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Accept</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Origin</b></td><td><b>Params</b></td></tr><tr><td style=\"display: none\">*</td><td><a href=\"http://terminology.hl7.org/5.5.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-read\">Test script operation code read</a>: Read</td><td>Bundle</td><td>Receive message</td><td>xml</td><td>1</td><td>true</td><td>1</td><td>/${bundleid-new-message-01}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the returned HTTP status is okay or created.</td><td>response</td><td>in</td><td>200,201</td><td>false</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><blockquote><p><b>id</b></p>carecommunication-create-forward-message-02</blockquote><p><b>name</b>: Create a CareCommunication forward-message Message 02</p><p><b>description</b>: Post CareCommunication to the server.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Origin</b></td><td><b>RequestId</b></td><td><b>SourceId</b></td></tr><tr><td style=\"display: none\">*</td><td><a href=\"http://terminology.hl7.org/5.5.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-create\">Test script operation code create</a>: Create</td><td>Bundle</td><td>Post a carecommunication</td><td>1</td><td>true</td><td>1</td><td>create-message-forward-message-02</td><td>create-forward-message-02</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>ValidateProfileId</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Validates the bundle against http://medcomfhir.dk/ig/carecommunication/ImplementationGuide/dk.fhir.ig.dk-medcom-carecommunication</td><td>request</td><td>carecommunication</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the returned HTTP status is okay or created.</td><td>response</td><td>in</td><td>200,201</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Resource</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the client request payload contains a Bundle resource type.</td><td>request</td><td>Bundle</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the previous MessageHeader.id is identical to Provenance.entity.what</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(entity.what.reference.contains('${messageHeaderid-new-message-01}')).exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the request resource contains the expected eventCoding.code.</td><td>request</td><td>Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'care-communication-message').allTrue()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the role is set to revision. Not used when testing the first message in a stream</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).entity.where(role = 'revision').exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the target reference in Provenance equals MessageHeader.id</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).where(target.reference.contains(%resource.entry[0].resource.id)).exists()</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the 2 Provenance instances exists.</td><td>request</td><td>Bundle.entry.resource.ofType(Provenance).count()</td><td>equals</td><td>2</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that number of payloads is '2'</td><td>request</td><td>Bundle.entry.resource.ofType(Communication).payload.count() = '2'</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the sender SOR number is different from the previous message.</td><td>request</td><td>Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value != ${hospitalSOR-new-message})</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>Confirm that the content is different in the two messages</td><td>request</td><td>'${identifier-new-message-01}' != '${identifier-forward-message-02}'</td><td>false</td></tr></table></blockquote></blockquote></div>"
},
"url" : "http://medcomfhir.dk/ig/carecommunicationtestscript/carecommunication-send-forward-message",
"version" : "4.0.1",
"name" : "CareCommunicationTestScript",
"title" : "Forward CareCommunication",
"status" : "active",
"date" : "2024-07-15",
"contact" : [
{
"name" : "MedCom",
"telecom" : [
{
"system" : "email",
"value" : "mailto:fhir@medcom.dk"
}
]
}
],
"description" : "Forward CareCommunication",
"copyright" : "MedCom 2023",
"origin" : [
{
"index" : 1,
"profile" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types",
"code" : "FHIR-Client"
}
}
],
"destination" : [
{
"index" : 1,
"profile" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types",
"code" : "FHIR-Server"
}
}
],
"fixture" : [
{
"id" : "create-new-message-01",
"autocreate" : false,
"autodelete" : false,
"resource" : {
"reference" : "/Fixtures/CareCommunication-fixture.xml"
}
},
{
"id" : "create-forward-message-02",
"autocreate" : false,
"autodelete" : false,
"resource" : {
"reference" : "/Fixtures/CareCommunication-fixture-empty.xml"
}
}
],
"profile" : [
{
"id" : "carecommunication",
"reference" : "http://medcomfhir.dk/ig/carecommunication/StructureDefinition/medcom-careCommunication-message"
}
],
"variable" : [
{
"name" : "messageHeaderid-new-message-01",
"expression" : "Bundle.entry[0].resource.id",
"sourceId" : "create-message-new-message-01"
},
{
"name" : "destinationUri-new-message-01",
"expression" : "Bundle.entry.resource.ofType(MessageHeader).destination.endpoint",
"sourceId" : "create-message-new-message-01"
},
{
"name" : "bundleid-new-message-01",
"expression" : "Bundle.id",
"sourceId" : "create-message-new-message-01"
},
{
"name" : "hospitalSOR-new-message-01",
"expression" : "Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value",
"sourceId" : "create-message-new-message-01"
},
{
"name" : "messageHeaderid-forward-message-02",
"expression" : "Bundle.entry[0].resource.id",
"sourceId" : "create-message-forward-message-02"
},
{
"name" : "identifier-new-message-01",
"expression" : "Bundle.entry.resource.ofType(Communication).identifier.value",
"sourceId" : "create-message-new-message-01"
},
{
"name" : "identifier-forward-message-02",
"expression" : "Bundle.entry.resource.ofType(Communication).identifier.value",
"sourceId" : "create-message-forward-message-02"
}
],
"setup" : {
"action" : [
{
"operation" : {
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code" : "delete"
},
"resource" : "Bundle",
"description" : "System-generated search, delete operations from conditional delete on Bundle MessageHeader.destination.endpoint",
"accept" : "xml",
"encodeRequestUrl" : true,
"params" : "?message.destination-uri=${destinationUri-new-message}"
}
},
{
"operation" : {
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code" : "create"
},
"resource" : "Bundle",
"description" : "Create the Bundle resource in XML format on the destination server.",
"accept" : "xml",
"contentType" : "xml",
"encodeRequestUrl" : true,
"sourceId" : "create-new-message-01"
}
},
{
"operation" : {
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code" : "updateCreate"
},
"resource" : "Bundle",
"description" : "Update the Bundle.id in XML format on the destination server, so it corresponds to $bundleid-new-message-01.",
"accept" : "xml",
"contentType" : "xml",
"encodeRequestUrl" : true,
"params" : "/${bundleid-new-message-01}",
"sourceId" : "create-new-message-01"
}
},
{
"assert" : {
"description" : "Confirm that the returned HTTP status is okay or created.",
"direction" : "response",
"operator" : "in",
"responseCode" : "200,201",
"warningOnly" : false
}
}
]
},
"test" : [
{
"id" : "message-read-new-message-01",
"name" : "Get a new-message message 01",
"description" : "GET a message. The expected response is a 200(OK) with a payload of the message resource in XML format.",
"action" : [
{
"operation" : {
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code" : "read"
},
"resource" : "Bundle",
"description" : "Receive message",
"accept" : "xml",
"destination" : 1,
"encodeRequestUrl" : true,
"origin" : 1,
"params" : "/${bundleid-new-message-01}"
}
},
{
"assert" : {
"description" : "Confirm that the returned HTTP status is okay or created.",
"direction" : "response",
"operator" : "in",
"responseCode" : "200,201",
"warningOnly" : false
}
}
]
},
{
"id" : "carecommunication-create-forward-message-02",
"name" : "Create a CareCommunication forward-message Message 02",
"description" : "Post CareCommunication to the server.",
"action" : [
{
"operation" : {
"type" : {
"system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
"code" : "create"
},
"resource" : "Bundle",
"description" : "Post a carecommunication",
"destination" : 1,
"encodeRequestUrl" : true,
"origin" : 1,
"requestId" : "create-message-forward-message-02",
"sourceId" : "create-forward-message-02"
}
},
{
"assert" : {
"description" : "Validates the bundle against http://medcomfhir.dk/ig/carecommunication/ImplementationGuide/dk.fhir.ig.dk-medcom-carecommunication",
"direction" : "request",
"validateProfileId" : "carecommunication",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the returned HTTP status is okay or created.",
"direction" : "response",
"operator" : "in",
"responseCode" : "200,201",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the client request payload contains a Bundle resource type.",
"direction" : "request",
"resource" : "Bundle",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the previous MessageHeader.id is identical to Provenance.entity.what",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Provenance).where(entity.what.reference.contains('${messageHeaderid-new-message-01}')).exists()",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the request resource contains the expected eventCoding.code.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(MessageHeader).event.as(Coding).select(code = 'care-communication-message').allTrue()",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the role is set to revision. Not used when testing the first message in a stream",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Provenance).entity.where(role = 'revision').exists()",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the target reference in Provenance equals MessageHeader.id",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Provenance).where(target.reference.contains(%resource.entry[0].resource.id)).exists()",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the 2 Provenance instances exists.",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Provenance).count()",
"operator" : "equals",
"value" : "2",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that number of payloads is '2'",
"direction" : "request",
"expression" : "Bundle.entry.resource.ofType(Communication).payload.count() = '2'",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the sender SOR number is different from the previous message.",
"direction" : "request",
"expression" : "Bundle.entry[0].resource.sender.reference.resolve().identifier.where(system = 'urn:oid:1.2.208.176.1.1').value != ${hospitalSOR-new-message})",
"warningOnly" : false
}
},
{
"assert" : {
"description" : "Confirm that the content is different in the two messages",
"direction" : "request",
"expression" : "'${identifier-new-message-01}' != '${identifier-forward-message-02}'",
"warningOnly" : false
}
}
]
}
]
}
XIG built as of ??metadata-date??. Found ??metadata-resources?? resources in ??metadata-packages?? packages.